home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form1
- AutoRedraw = -1 'True
- BorderStyle = 4 'Fixed ToolWindow
- Caption = "Load information from a Dll"
- ClientHeight = 3300
- ClientLeft = 45
- ClientTop = 285
- ClientWidth = 5745
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3300
- ScaleWidth = 5745
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 'CenterScreen
- Begin VB.Line Line3
- X1 = 5760
- X2 = 0
- Y1 = 3240
- Y2 = 3240
- End
- Begin VB.Line Line2
- X1 = 3240
- X2 = 3240
- Y1 = 2400
- Y2 = 3240
- End
- Begin VB.Label Label3
- BackStyle = 0 'Transparent
- Caption = "<--click the link to visit mostafa page for more samples or to send your comments"
- Height = 615
- Left = 3480
- TabIndex = 2
- Top = 2520
- Width = 2175
- End
- Begin VB.Line Line1
- X1 = 0
- X2 = 6120
- Y1 = 2400
- Y2 = 2400
- End
- Begin VB.Label Label2
- BackStyle = 0 'Transparent
- Caption = "Mostafa Mohamed"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = -1 'True
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FF0000&
- Height = 255
- Left = 1800
- MouseIcon = "frmmain.frx":0000
- MousePointer = 99 'Custom
- TabIndex = 1
- ToolTipText = "Mostafa web page"
- Top = 2520
- Width = 1335
- End
- Begin VB.Label Label1
- BackStyle = 0 'Transparent
- Caption = "Sample created by:-"
- Height = 255
- Left = 120
- TabIndex = 0
- Top = 2520
- Width = 1695
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- 'This sample created by Mostafa Mohamed,any comments please
- 'send me an email from my page at
- '"Explorer http://www.geocities.com/ResearchTriangle/Campus/4598/Vb1.HTML"
- Dim dll As Long
- Public Function stringfromdll(id As Long, dll As Long) As String
- Dim rtrn As Long
- Dim bstr As String * 255
- 'this function will load the string from the dll by the id and will put it on bstr
- rtrn = LoadString(dll, id, bstr, 255)
- 'format the string
- stringfromdll = Mid(bstr, 1, InStr(1, bstr, Chr(0)) - 1)
- End Function
- Private Sub Form_Load()
- 'load the dll using windows api function "LoadLibrary"
- dll = LoadLibrary(App.Path & "\myres.dll")
- 'print first string
- Print stringfromdll(101, dll)
- Print stringfromdll(102, dll)
- Print stringfromdll(103, dll)
- Print stringfromdll(104, dll)
- Print stringfromdll(105, dll)
- Print stringfromdll(107, dll)
- Print stringfromdll(108, dll)
- 'close the library
- FreeLibrary dll
- End Sub
- Private Sub Label2_Click()
- On Error Resume Next
- Shell ("Explorer http://www.geocities.com/ResearchTriangle/Campus/4598/Vb1.HTML"), vbNormalNoFocus
- End Sub
-